home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Demos
/
A.D. Software
/
OOFILE
/
Buildable, limited OOFILE
/
samples
/
ooftst15.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-03-25
|
1KB
|
51 lines
// Copyright 1995 A.D. Software. All Rights Reserved
// OOFTST15
// demonstrates opening two databases sequentially
// Simple stream I/O is used to interact with the user.
#include "oofile.hpp"
#include "ooftst01.inc"
#include "ooftst02.inc"
int main()
{
cout << "OOFILE Validation Suite - Test 15\n"
<< "Simple test to demonstrate opening two databases" << endl
<< "at different times" << endl;
if (dbConnect::fileExists("ooftst15.db")) {
theDB.openConnection("ooftst15.db");
}
else {
theDB.newConnection("ooftst15.db");
Patients.AddTestData();
}
cout << "Dumping the first database, Patients & Visits" << endl << endl
<< theDB
<< endl << endl;
theDB.close();
// now create the second database
dbConnect_ctree theDB2;
dbPeople People;
if (dbConnect::fileExists("ooftsx15.db")) {
theDB2.openConnection("ooftsx15.db");
}
else {
theDB2.newConnection("ooftsx15.db");
People.AddTestData();
}
cout << "Dumping the second database, People" << endl << endl << theDB2;
cout << "Done" << endl;
return EXIT_SUCCESS;
}